1. Field of the Invention
The present invention relates to a moving picture processor, a method for processing a moving picture, a computer program product for executing an application for a moving picture processor, for detecting moving vectors from a moving picture.
2. Description of the Related Art
In recent years, the international standardization of picture coding has been rapidly pursued. Picture coding schemes include joint photographic experts group (JPEG) which stands is a still picture coding standard; H.263 and H.264, which are moving picture coding standards for communication media; and moving picture experts group (MPEG) which is moving picture coding standards for storage media. In each coding scheme, a coding algorithm is employed for realizing a bit rate (transmission rate) that serves a purpose thereof. In JPEG, color data is compressed by a scheme based on Huffman coding and discrete cosine transform (DCT).
On the other hand, in moving picture compression technique such as H.263 and MPEG, generally, orthogonal transform such as DCT is used for the spatial reduction of the amount of information as in JPEG, and motion compensation (MC) is used for the temporal reduction of the amount of information. General MC is performed by executing interframe prediction using a motion vector, i.e., compensating the amount of motion between a current picture and a reference picture.
Further, at the time of the detection of a motion vector, in a search area set in the reference picture, block matching is performed which detects a block that gives a minimum for an evaluation function such as the sum of absolute differences (SAD) from a target block of the current picture. The motion vector refers to a vector indicating the horizontal and vertical relative positions between a target block of the current picture for which motion is to be detected and a block of the reference picture that is most similar to the target block.
On the other hand, in the case where consecutive blocks equally move by translation or the like, the respective motion vectors of the consecutive blocks are equal. However, variations occur in motion vectors for the following reasons (1) to (3) and the like:
(1) In block matching, motion vectors are detected based on only the result of an operation using an evaluation function. Accordingly, in the case where errors such as white noise are included in pictures, variations occur in the detected motion vectors.
(2) Generally, the amount of motion of a substance in a picture is not an integer multiple of a pixel. Accordingly, in the case of processing in units of macroblocks, the amount of motion of each macroblock is approximated to an integer multiple of one pixel, a half pixel, a quarter pixel, or the like. As a result, variations due to approximation occur in the motion vectors.(3) If block matching is used in the case where a picture has a flat figure, the case where a pattern is repeated, or the like, a similar different portion is apt to be matched. Similarly, in the case where a similar pattern accidentally exists in another portion, there is a possibility that another portion may be matched.
In the case where consecutive motion vectors are equal, the amount of code of the motion vectors can be reduced. However, slight variations occurring in consecutive motion vectors prevent the amount of code of the motion vectors from being reduced. In particular, in the case of a high compression rate, the amount of code of motion vectors becomes dominant in the total amount of code, and compression efficiency is decreased. There also arise problems such as the one that block noise tends to be pronounced when motion vectors differ from adjacent macroblocks. As related art for reducing the amount of code relating to motion vectors, a technique has been proposed in which a plurality of motion vector candidates having matching errors not more than a certain value are detected for one macroblock and in which the motion vector candidate having a smallest difference from a most recently detected motion vector is selected from the plurality of motion vector candidates.
However, in the above-described related art, it is assumed that the most recently detected motion vector is optimum. Accordingly, in the case where the most recently detected motion vector is not optimum, influence is propagated to subsequent motion vectors. As a result, there is a possibility that the total amount of code may increase. In particular, when motion detection is performed on subsampled pictures, the possibility of a false detection of a motion vector becomes high. Accordingly, there is a high possibility that an optimum motion vector cannot be detected by merely selecting the motion vector candidate having a smallest difference from a motion vector of an immediately preceding macroblock. Further, even if a plurality of motion vector candidates are detected in subsampled pictures, there is a possibility that an optimum motion vector may not be included in the plurality of motion vector candidates.